package com.atguigu.eduservice.controller;

import com.atguigu.commonutils.Result;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
// 解决跨域
//@CrossOrigin
@RequestMapping("/edu/service/user")
public class EduLoginController {

    @PostMapping("login")
    public Result login(){
        Map<String, Object> map=new HashMap();
        map.put("token","admin");
        return Result.ok(map);
    }
    @GetMapping("info")
    public Result info(){
        Map<String, Object> map=new HashMap<>();
        map.put("roles","[admin]");
        map.put("name","admin");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return Result.ok(map);
    }

}
